package pl.basesoft.domain.vo;

import javax.persistence.Embeddable;

@Embeddable
public class Phone {
	
	String countryExtension;
	String provinceExtension;
	String number;
	
	
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime
				* result
				+ ((countryExtension == null) ? 0 : countryExtension.hashCode());
		result = prime * result + ((number == null) ? 0 : number.hashCode());
		result = prime
				* result
				+ ((provinceExtension == null) ? 0 : provinceExtension
						.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Phone other = (Phone) obj;
		if (countryExtension == null) {
			if (other.countryExtension != null)
				return false;
		} else if (!countryExtension.equals(other.countryExtension))
			return false;
		if (number == null) {
			if (other.number != null)
				return false;
		} else if (!number.equals(other.number))
			return false;
		if (provinceExtension == null) {
			if (other.provinceExtension != null)
				return false;
		} else if (!provinceExtension.equals(other.provinceExtension))
			return false;
		return true;
	}
	
	
}
